

<template>
  <van-nav-bar title="扫描二维码" />
 <div>

   <van-cell-group>
 <van-field v-model="data.codeStr" label="二维码内容" placeholder="" />
</van-cell-group>
 
   <van-button type="primary" style=" margin-top: 20px;" @click="doCall">开始扫码</van-button>
 </div>
</template>

<script setup lang='ts' name='' >
import { reactive, ref } from "vue";
import { showToast } from 'vant';


// Your script here

let data = reactive({
  codeStr:"",
 });


const doCall = ()=>{


 (window as any).whJSBridge.scanQRCode()
 .then((res:any)=>{
   console.log("回调参数",res)
   showToast(res)
   data.codeStr = res
 })
   

}



</script>

<style scoped >
/* Your styles here */
</style>